<%@ Page Language="C#" MasterPageFile="~/IPMSMasterPage.master" AutoEventWireup="true" CodeFile="OptCountries.aspx.cs" Inherits="OptCountries" Title="Project Monitoring System" Culture="auto:en-US" UICulture="auto" meta:resourcekey="PageResource1" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server" Visible="false"/>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder2" runat="Server">
    <div style="margin-left:10px;margin-right:10px;">
        <asp:Panel ID="SearchPanel" runat="server">
            <fieldset>
                <legend>
                    <asp:Label ID="lblSearch" runat="server" Text="Search" meta:resourcekey="lblSearchResource1"></asp:Label>
                </legend>
                <table>
                    <tr>
                        <td>
                            <asp:Label ID="lblSearchCountry" runat="server" Text="Country" meta:resourcekey="lblCountryResource1"></asp:Label>
                        </td>
                        <td>
                            <asp:TextBox ID="txtSearchCountry" runat="server"></asp:TextBox>&nbsp;
                        </td>
                        <td width="10"></td>
                        <td>
                            <asp:Label ID="lblSearchEnglishName" runat="server" Text="English Name" meta:resourcekey="lblCountryEngResource1"></asp:Label>
                        </td>
                        <td>
                            <asp:TextBox ID="txtSearchEnglishName" runat="server"></asp:TextBox>
                        </td>
                         <td>
                            <asp:Label ID="lblSearchChineseName" runat="server" Text="Chinese Name" meta:resourcekey="lblCountryChiResource1"></asp:Label>
                        </td>
                        <td>
                            <asp:TextBox ID="txtSearchChineseName" runat="server"></asp:TextBox>
                        </td>
                        <td width="10"></td>
                        <td>
                            <asp:Button ID="btnSearch" runat="server" CssClass="submit" Text="Search" CausesValidation="false" meta:resourcekey="btnSearchResource1" OnClick="btnSearch_Click" />
                            <asp:Button ID="btnNewCountry" runat="server" CausesValidation="False" CssClass="submit" Text="New Country" meta:resourcekey="btnNewCountryResource1" OnClick="btnNewCountry_Click" />
                        </td>
                    </tr>
                </table>
            </fieldset>
        </asp:Panel>
        <table width="100%">
            <tr>
                <td align="center">
                    <asp:Label ID="lblError" runat="server" ForeColor="Red" CssClass="error" meta:resourcekey="lblErrorResource1"></asp:Label>
                </td>
            </tr>
        </table>
        <asp:Panel ID="panelActive" runat="server" meta:resourcekey="GridPanelResource1">
            <fieldset>
                <legend>
                    <asp:Label ID="lblActive" runat="server" Text="Active Country" meta:resourcekey="lblActiveResource1"></asp:Label>
                </legend>
            <table>
                <tr>
                    <td>
                        <asp:GridView CssClass="Grid" ID="gvActive" runat="server" AutoGenerateColumns="False"
                            BackColor="#DEBA84" BorderColor="#660000" GridLines="Both" BorderStyle="Solid"
                            BorderWidth="1px" CellPadding="0" CellSpacing="0" meta:resourcekey="GridView1Resource1" 
                            DataKeyNames="Country"
                            EmptyDataText="No Country record(s) available." 
                            AllowPaging="True" PageSize="10" Width="100%" 
                            onpageindexchanging="gvActive_PageIndexChanging" 
                            onrowcommand="OnRowCommand">
                            <Columns>
                                <asp:BoundField DataField="Country" HeaderText="Country" ReadOnly="True" SortExpression="Country" HeaderStyle-Width="200" meta:resourcekey="BoundFieldResource1"/>
                                <asp:BoundField DataField="EnglishName" HeaderText="English Name" SortExpression="EnglishName" HeaderStyle-Width="300" meta:resourcekey="BoundFieldResource2"/>
                                <asp:BoundField DataField="ChineseName" HeaderText="Chinese Name" SortExpression="ChineseName" HeaderStyle-Width="300" meta:resourcekey="BoundFieldResource3"/>
                                <asp:CheckBoxField DataField="PCTYN" Visible="false" HeaderText="PCTYN" SortExpression="PCTYN" HeaderStyle-Width="100" ItemStyle-HorizontalAlign="center" meta:resourcekey="CheckBoxFieldResource4"/>
                                <asp:BoundField DataField="UpdateIP" HeaderText="IP Address" ItemStyle-HorizontalAlign="left" meta:resourcekey="BoundFieldResource5"/>
                                <asp:BoundField DataField="UpdateBy" HeaderText="Updated By" ItemStyle-HorizontalAlign="left" meta:resourcekey="BoundFieldResource6"/>
                                <asp:BoundField DataField="UpdateDate" HeaderText="Last Update Date" HeaderStyle-Width="200" ItemStyle-HorizontalAlign="left" meta:resourcekey="BoundFieldResource7"/>
                                <asp:TemplateField HeaderText="" ItemStyle-Width="60" ItemStyle-HorizontalAlign="center">
                                    <ItemTemplate>
                                        <a href="OptCountriesUpdate.aspx?Country=<%# Eval("Country")%>"><img src="Images/icon-edit.gif" border="0" /></a>
                                        <asp:ImageButton ID="imgBtnDelete" CommandName="halfDelete" runat="server" ImageUrl="Images/icon-delete.jpg" OnClientClick="javascript:return confirm('Do you want to delete the record?');"/>
                                    </ItemTemplate>
                                </asp:TemplateField>
                           </Columns>
                            <HeaderStyle CssClass="GridHeaderStyle"/>
                            <RowStyle CssClass="GridRowStyle" />
                            <AlternatingRowStyle CssClass="GridAltRowStyle" />
                            <SelectedRowStyle CssClass="GridSelectedRowStyle" />
                            <PagerStyle CssClass="GridPagerStyle" ForeColor="White" />
                            <FooterStyle CssClass="GridFooterStyle" />
                        </asp:GridView>
                    </td>
                </tr>
            </table>
            </fieldset>
        </asp:Panel>
        <asp:Panel ID="panelDeleted" runat="server" meta:resourcekey="ActivePanelResource1">
            <fieldset>
            <legend>
                <asp:Label ID="lblDeleted" runat="server" Text="Deleted Country" meta:resourcekey="lblDeletedResource1"></asp:Label>
            </legend>
            <table>
                <tr>
                    <td>
                        <asp:GridView CssClass="Grid" ID="gvDeleted" runat="server" 
                            BackColor="#DEBA84" BorderColor="#660000"
                            BorderStyle="Solid" BorderWidth="1px" CellPadding="0" CellSpacing="0" Width="100%"
                            Height="1%" AllowPaging="True" PageSize="10" AllowSorting="True" 
                            EmptyDataText="No Deleted Country Record Available!"
                            AutoGenerateColumns="False" meta:resourcekey="gvActiveResource1" 
                            onpageindexchanging="gvDeleted_PageIndexChanging"
                            DataKeyNames="Country"
                            onrowcommand="OnRowCommand">
                            <Columns>
                                <asp:BoundField DataField="Country" HeaderText="Country" ReadOnly="True" SortExpression="Country" HeaderStyle-Width="200" meta:resourcekey="BoundFieldResource8"/>
                                <asp:BoundField DataField="EnglishName" HeaderText="English Name" SortExpression="EnglishName" HeaderStyle-Width="300" meta:resourcekey="BoundFieldResource9"/>
                                <asp:BoundField DataField="ChineseName" HeaderText="Chinese Name" SortExpression="ChineseName" HeaderStyle-Width="300" meta:resourcekey="BoundFieldResource10"/>
                                <asp:CheckBoxField DataField="PCTYN" Visible="false" HeaderText="PCTYN" SortExpression="PCTYN" HeaderStyle-Width="100" ItemStyle-HorizontalAlign="center" meta:resourcekey="CheckBoxFieldResource11"/>
                                <asp:BoundField DataField="DeleteIP" HeaderText="IP Address" ItemStyle-HorizontalAlign="left" meta:resourcekey="BoundFieldResource12"/>
                                <asp:BoundField DataField="DeleteBy" HeaderText="Deleted By" ItemStyle-HorizontalAlign="left" meta:resourcekey="BoundFieldResource13"/>
                                <asp:BoundField DataField="DeleteDate" HeaderText="Delete Date" HeaderStyle-Width="200"  ItemStyle-HorizontalAlign="left" meta:resourcekey="BoundFieldResource14"/>
                                <asp:TemplateField ItemStyle-Width="60" ItemStyle-HorizontalAlign="center" HeaderText="">
                                    <ItemTemplate>
                                        <asp:ImageButton ID="lbtnRestore" CommandName="Restore" runat="server" ImageUrl="Images/icon-save.gif"/>
                                        <asp:ImageButton ID="lbtnFroceDelete" CommandName="ForceDelete" runat="server" ImageUrl="Images/icon-trash.gif" OnClientClick="javascript:return confirm('Do you want to delete the record?');"/>
                                    </ItemTemplate>
                                </asp:TemplateField>
                            </Columns>
                            <HeaderStyle CssClass="GridHeaderStyle"/>
                            <RowStyle CssClass="GridRowStyle" />
                            <AlternatingRowStyle CssClass="GridAltRowStyle" />
                            <SelectedRowStyle CssClass="GridSelectedRowStyle" />
                            <PagerStyle CssClass="GridPagerStyle" ForeColor="White" />
                            <FooterStyle CssClass="GridFooterStyle" />
                        </asp:GridView>
                    </td>
                </tr>
            </table>
            </fieldset>
        </asp:Panel>
        
    </div>
</asp:Content>
